"""\
Tools for adding basis sets to atom lists.

"""

from pyquante2.basis import data

sym2pow = {
    'S' : [(0,0,0)],
    'P' : [(1,0,0),(0,1,0),(0,0,1)],
    'D' : [(2,0,0),(1,1,0),(1,0,1),(0,2,0),(0,1,1),(0,0,2)],
    'F' : [(3,0,0),(2,1,0),(2,0,1),(1,2,0),(1,1,1),(1,0,2),
           (0,3,0),(0,2,1),(0,1,2), (0,0,3)]
    }

am2sym = ['S','P','D','F','G','H','I','J']
am2pow = [[(0,0,0)],
          [(1,0,0),(0,1,0),(0,0,1)],
          [(2,0,0),(1,1,0),(1,0,1),(0,2,0),(0,1,1),(0,0,2)],
          [(3,0,0),(2,1,0),(2,0,1),(1,2,0),(1,1,1),(1,0,2),
           (0,3,0),(0,2,1),(0,1,2), (0,0,3)]
          ]          

# Invert arrays

sym2am = {sym:i for i,sym in enumerate(am2sym)}

pow2sym = {}
for sym in sym2pow:
    for p in sym2pow[sym]:
        pow2sym[p] = sym

pow2fullsym = {(0,0,0): 's',
               (1,0,0): 'px',
               (0,1,0): 'py',
               (0,0,1): 'pz',
               (2,0,0): 'dx2',
               (0,2,0): 'dy2',
               (0,0,2): 'dz2',
               (1,1,0): 'dxy',
               (0,1,1): 'dyz',
               (1,0,1): 'dxz',
               }
